<template>
  <view class="con">
    <image class="bg" src="../../static/home/bg.png" mode="aspectFill" />
    <view class="back" @click="goBack">
      <u-icon name="arrow-left" size="24" color="#fff"></u-icon>
    </view>
    <view class="info">
      <view class="head">
        <image src="" mode="aspectFill" />
        <view class="r">
          <view class="name">用户昵称</view>
          <view class="zh">账号：2878www</view>
          <view class="zh">IP属地：浙江</view>
        </view>
      </view>
      <view class="ctn"> 账号简介是关于一个账号的简短介绍或者称为概述。它通常包含关于账号主人的一些基本信息，如职业、兴趣、特长等，也包含账号的主要用途或特点</view>
      <view class="fn">
        <view class="l">
          <view class="item1">
            <view>880</view>
            <view class="x">关注</view>
          </view>
          <view class="item1">
            <view>880</view>
            <view class="x">粉丝</view>
          </view>
          <view class="item1">
            <view>880</view>
            <view class="x">动态</view>
          </view>
        </view>
        <view class="gzBox"><u-icon name="plus" color="#fff" size="14"></u-icon>关注</view>
      </view>
    </view>
    <view class="bxo">
      <view class="t">他的动态</view>
      <view class="box">
        <view class="item" v-for="(item, index) in 4" :key="index" @click="goPage('/pages/home/caseDetails')">
          <image class="img" src="" mode="aspectFill" />
          <view class="btm">
            <view class="tit">大声安利私藏好物</view>
            <view class="user">
              <view class="l">
                <u-avatar size="18"></u-avatar>
                用户昵称
              </view>
              <view class="zan">
                <image @click="likeFn(1)" v-if="'1' === '1'" class="heart" src="../../static/home/red_heart.png" mode="aspectFill" />
                <image @click="likeFn(1)" v-else class="heart" src="../../static/home/heat.png" mode="aspectFill" />
                <text> 845</text>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import { goBack } from "@/utils/commonFn";
import { goPage } from "@/utils/commonFn";

const likeFn = async (item: any) => {
  if (item.likeFlag === "1") {
    item.likeFlag = "0";
    --item.likeCount;
  } else {
    item.likeFlag = "1";
    ++item.likeCount;
  }
};
</script>
<style lang="less" scoped>
.bg {
  width: 100%;
  height: 744rpx;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
}
.info {
  padding: 0 30rpx;
  position: relative;
  z-index: 9;
  color: #fff;
  margin-top: 160rpx;
  .head {
    display: flex;
    align-items: center;
    image {
      width: 160rpx;
      height: 160rpx;
      background: salmon;
      border-radius: 50%;
      margin-right: 24rpx;
    }
    .r {
      width: calc(100% - 184rpx);
      .name {
        font-size: 40rpx;
      }
      .zh {
        font-size: 24rpx;
        color: #8a8a8d;
        margin-top: 12rpx;
      }
    }
  }
  .ctn {
    width: 80%;
    font-size: 24rpx;
    color: #b0b3b4;
    margin-top: 32rpx;
  }
  .fn {
    display: flex;
    justify-content: space-between;
    margin-top: 40rpx;
    .l {
      display: flex;
      gap: 58rpx;
    }
    .item1 {
      font-size: 36rpx;
      color: #ffffff;
      text-align: center;
      .x {
        font-size: 22rpx;
        color: #8a8a8d;
      }
    }
  }
  .gzBox {
    background: #81d8d0;
    border-radius: 200rpx 200rpx 200rpx 200rpx;
    display: flex;
    align-items: center;
    padding: 0rpx 40rpx;
    font-size: 28rpx;
    color: #ffffff;
    gap: 8rpx;
  }
}
.bxo {
  z-index: 999;
  position: relative;
  margin-top: 60rpx;

  .t {
    background: #ffffff;
    border-radius: 32rpx 32rpx 0rpx 0rpx;
    padding: 26rpx 34rpx;
  }
}
.box {
  column-count: 2;
}
.item {
  margin-bottom: 20rpx;
  background: #ffffff;
  border-radius: 0rpx 0rpx 16rpx 16rpx;
  .btm {
    padding: 18rpx;
  }
  .img {
    width: 100%;
    background: #d3afa2;
  }
  .tit {
    font-size: 28rpx;
    color: #000000;
  }
  .user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24rpx;
    .l {
      display: flex;
      align-items: center;
      font-size: 24rpx;
      color: #8a8a8d;
    }
  }
}
.zan {
  display: flex;
  align-items: center;
  font-size: 28rpx;
  color: #8a8a8d;
  .heart {
    width: 36rpx;
    height: 36rpx;
    margin-right: 6rpx;
  }
}
</style>
